
/*
 * HadoopMapper.java
 *
 * Created on May 13, 2012, 3:45:50 PM
 */

package PreS;


import java.io.IOException;
// import org.apache.commons.logging.Log;
// import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.IntWritable;

/**
 *
 * @author crazymooner
 */
public class HadoopMapper extends MapReduceBase implements Mapper<Text,Text,IntWritable,IntWritable> {
    // The Karmasphere Studio Workflow Log displays logging from Apache Commons Logging, for example:
    // private static final Log LOG = LogFactory.getLog("PreS.HadoopMapper");

    @Override
    public void map(Text key, Text value, OutputCollector<IntWritable, IntWritable> output, Reporter reporter)
            throws IOException {
        output.collect(new IntWritable(Integer.parseInt(value.toString())), new IntWritable(1));
    }
}
